Conditions | 1 |
Paths | 2 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import GoogleMap from './blocks/maps/modules/GoogleMap'; |
||
10 | init: () => { |
||
11 | [].forEach.call(document.querySelectorAll('*[data-module="google-map"]'), container => { |
||
12 | let instanceId = createRandomId(); |
||
13 | let options = container.getAttribute('data-options'); |
||
14 | |||
15 | if (typeof options == 'undefined' || options == '') { |
||
16 | options = {}; |
||
17 | } else { |
||
18 | options = JSON.parse(options); |
||
19 | } |
||
20 | |||
21 | window.GoogleMap.instances.push(new GoogleMap(container, Object.assign({ |
||
22 | instanceId: instanceId |
||
23 | }, options))); |
||
24 | }); |
||
25 | } |
||
26 | }; |
||
48 | }); |